/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package forms;

import com.sun.lwuit.Button;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.plaf.Border;
import com.sun.lwuit.plaf.Style;

/**
 *
 * @author ademar.victorino
 */
public abstract class AbstractForm extends Form {

    public AbstractForm(String title) {
        super(title);
        //setTransitionOutAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, false, 400));
        //setTransitionInAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, true, 500));
        initStyles();
    }

    private void initStyles() {
        getStyle().setBgColor(0xe8e7e7);
        getStyle().setBorder(Border.createEmpty());
        Style s = new Style();
        s.setBgColor(0xffcc66);
        s.setBorder(Border.createRoundBorder(8, 8));
        s.setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_UNDERLINED, Font.SIZE_LARGE));
        setTitleStyle(s);
    }

    public AbstractForm() {
        initStyles();
    }

    public void addComponent(String s) {
        super.addComponent(new Label(s));

    }

    public void setDefaultBtnStyle(Button b) {

        b.getStyle().setBorder(Border.createRoundBorder(4, 2));
        b.getStyle().setBgColor(0xcccccc);
        b.getStyle().setBgSelectionColor(0xffcc66);
        b.getStyle().setFgSelectionColor(0x000000);
    }
}
